package com.kyzh.core.adapters

import android.view.View
import android.view.ViewGroup
import com.gushenge.core.beans.Banner
import com.kyzh.core.R
import com.kyzh.core.utils.loadImage
import com.makeramen.roundedimageview.RoundedImageView
import com.zhpan.bannerview.BaseBannerAdapter
import com.zhpan.bannerview.BaseViewHolder

class ReViewImageAdapter:BaseBannerAdapter<Banner>() {

    override fun getLayoutId(viewType: Int): Int {
        return R.layout.review_imageview
    }

    override fun createViewHolder(parent: ViewGroup, itemView: View, viewType: Int): ReViewImageViewHolder {
        return ReViewImageViewHolder(itemView)
    }

    override fun bindData(
        holder: BaseViewHolder<Banner>?,
        data: Banner?,
        position: Int,
        pageSize: Int
    ) {
        val imageView: RoundedImageView? = holder?.findViewById(R.id.image)
        imageView?.loadImage(data?.image)
    }

}